package com.sc.nft.mapper;

import cn.hutool.core.date.DateTime;
import com.sc.nft.dto.EcologicalBenefitDTO;
import com.sc.nft.entity.UserEcologyHatchIncomeRecord;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

/**
 * 生态-用户收益记录表(sc_user_ecology_hatch_income_record)数据Mapper
 *
 * @author Sun
 * @description 由 Mybatisplus Code Generator 创建
 * @since 2023-10-13 17:22:12
 */
@Mapper
public interface UserEcologyHatchIncomeRecordMapper extends BaseMapper<UserEcologyHatchIncomeRecord> {

    /**
     * 获取用户的收益总和(动态收益)
     *
     * @param userId
     * @return
     */
    BigDecimal getSumIncomeByUserId(@Param("userId") Long userId);

    /**
     * 获取当日收益总和
     *
     * @param now
     * @return
     */
    BigDecimal getLastWeekSumIncome();

    /**
     * 获取平台这周收益总和
     *
     * @return
     */
    List<EcologicalBenefitDTO> capturePlatformRevenue();

    /**
     * 获取DAO这周收益总和
     *
     * @return
     */
    List<EcologicalBenefitDTO> captureDaoRevenue();
}
